Title Banner


Technotes


CD Remote Database Format



Technote DV 25February 1994



Written by: Brian Bechtel February 1994

This Technical Note describes the format of the "CD Remote Programs" database, as used in the "CD Remote" desk accessory, the Hypercard CD Audio XCMDs, etc.


Introduction

The file "CD Remote Programs" is used by the CD Remote desk accessory, AppleCD Audio Player, and other applications to retain information about an audio CD. This file contains some master data in an `IndX' resource. For each CD that has been entered into the database, a resource of type `ProG' and a resource of type `STR#' are kept. There is only one `IndX' resource, number 128, in the "CD Remote Programs" file. There is a `ProG' and `STR#' resource for each CD which has been entered into the database. The number of the `ProG' and `STR#' resource are the same number for each CD. This number is generated by a call to Unique1ID.

`IndX' Resource Format

The initial two bytes of the `IndX' resource are a version number. The next two bytes are the number of CDs in the database. The `IndX' resource contains a six byte entry for each CD. The first byte is the number of tracks on the CD. The next three bytes are the number of (1/75th of a second) blocks on the CD. The last two bytes are the resource number of the ProG and STR# resources for this CD. Whenever a new CD is entered into the database, a new resource number is obtained by calling the Resource Manager routine Unique1ID.

An example IndX resource:

1214 0002 0B50 0240 276B 0C44 1365 1D0C

You would interpret this as:

version number: $1214

number of discs we know about: 2

number of tracks on first disc: 11

CD Identification: $500240 blocks (1/75th of a second) on this disc

Resource ID for ProG and STR# resources: 10091

number of tracks on second disc: 12

CD Identification: $441365 blocks on this disc

Resource ID for ProG and STR# resources: 7436

The ResEdit TMPL template for the `IndX' resource is as follows:

resource 'TMPL' (128, "IndX", purgeable) {
	{	/* array ItemArray: 7 elements */
		/* [1] */
		"Version Number",
		'HWRD',
		/* [2] */
		"Number of CDs",
		'OCNT',
		/* [3] */
		"****",
		'LSTC',
		/* [4] */
		"Number of tracks",
		'DBYT',
		/* [5] */
		"Number of blocks on CD",
		'H003',
		/* [6] */
		"Resource ID of ProG and STR#",
		'DWRD',
		/* [7] */
		"****",
		'LSTE'
	}
};

`ProG' Resource Format

The `ProG' resource contains the sequence for playing the audio tracks. By default, it goes from 1 to n, where n is the number of tracks on the CD. The numbers are stored in Binary Coded Decimal.

An example ProG resource:

000B 0101 0102 0103 0104 0105 0107 0106 0008 0109 0110 0111

You would interpret this as:

11 tracks on this disc.

Play track 7 before track 6

Don't play track 8

The ResEdit TMPL template for the `ProG' resource is as follows:

resource 'TMPL' (129, "ProG", purgeable) {
	{	/* array ItemArray: 5 elements */
		/* [1] */
		"Number of tracks",
		'OCNT',
		/* [2] */
		"****",
		'LSTC',
		/* [3] */
		"Play this track (1 = yes)",
		'DBYT',
		/* [4] */
		"Track number in BCD",
		'HBYT',
		/* [5] */
		"****",
		'LSTE'
	}
};

`STR#' Resource

Each `STR#' resource contains a list of strings. The first string in each resource is the volume title. The next n strings contain the titles of each of the tracks on the CD. This order matches with the `ProG' resource order; the nth+1 title is for track n only if the `ProG' resource is in normal, default order. If the user has changed the track order, the order of the strings in the STR# resource changes as well.

The STR# resource format is two bytes containing the number of strings, followed by the strings. Each string is a one-byte length followed by the characters. The ResEdit template for STR# resources is predefined in ResEdit. If it were not, it would look like this:

resource 'TMPL' (258, "STR#", purgeable) {
	{	/* array ItemArray: 4 elements */
		/* [1] */
		"NumStrings",
		'OCNT',
		/* [2] */
		"*****",
		'LSTC',
		/* [3] */
		"The string",
		'PSTR',
		/* [4] */
		"*****",
		'LSTE'
	}
};


Further Reference:

Tech Support
Technotes
Previous Technote | Contents | Next Technote


Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help